import { Component, OnInit } from '@angular/core';
import {Award} from "../svrs/domain";
import {AwardService} from "../svrs/award.service";
import {ActivatedRoute} from "@angular/router";

@Component({
  selector: 'app-award',
  templateUrl: './award.component.html',
  styleUrls: ['./award.component.css']
})
export class AwardComponent implements OnInit {
  award:Award;
  constructor(svr:AwardService,rs:ActivatedRoute) {
    rs.params.subscribe((par:any)=>{
      if(par && par.prize){
        svr.award(par.prize).subscribe(data => this.award = data);
      }
    });

  }

  ngOnInit() {

  }
}
